package com.pro.control;

import com.pro.dao.LoginRecordMapper;
import com.pro.entity.JsonData;
import com.pro.entity.LoginRecord;
import com.pro.service.LoginRecordService;
import eu.bitwalker.useragentutils.Browser;
import eu.bitwalker.useragentutils.UserAgent;
import eu.bitwalker.useragentutils.Version;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/LoginRecord")
public class LoginRecordController {
    @Autowired
    private LoginRecordService loginRecordService;

    //获取登录日志表
    //分页查询
    @RequestMapping("/getLoginRecordTable")
    @ResponseBody
    public JsonData getTable(Integer page, Integer limit, Integer gid){
        JsonData jsonData = new JsonData();
        List<LoginRecord> table = loginRecordService.getTable(page, limit, gid);
        return table!=null?JsonData.buildSuccess(table):JsonData.buildError("服务器错误");
    }
}
